<div class='form'>
  <% form_for [@style,@material],:html=>{:multipart=>true} do |f| %>
    <%= f.error_messages %>

    <p>
      <label for="material_style_id">所属款式</label>
      <%=  select("material", "style_id",Style.find(:all,:order => 'sort_order').collect {|c| [ c.name, c.id ] },:prompt => "请选择..") %>
    </p>

    <p>
      <label for="material_name">颜色</label>
      <%= f.text_field :name %>
    </p>

    <p>
      <label for="material_sn">编号</label>
      <%= f.text_field :sn %>
    </p>

    <p>
      <label for="material[size_array]">尺寸</label>
      <% Material::SIZES.each do |c| %>
        <%= c[0] + check_box("material[size_array]",c[0],{:checked=>@material.tee_size && @material.tee_size.split(",").include?(c[0])},c[0]) %>
      <% end %>
    </p>

    <p>
      <label for="material_image─url">正面图片</label>
      <%= file_column_field "material", "image_url" %>
    </p>

    <p>
      <label for="material_back_image─url">背面图片</label>
      <%= file_column_field "material", "back_image_url" %>
    </p>

    <p>
      <label for="material_detail_image_url2">局部图片</label>
      <%= file_column_field "material", "detail_image_url2" %>
    </p>

    <p>
      <label for="material_detail_image_url1">模特图片</label>
      <%= file_column_field "material", "detail_image_url1" %>
    </p>

    <p>
      <label for="material_price">价格</label>
      <%= f.text_field :price %>
    </p>

    <p>
      <label for="material_quantity">库存数量</label>
      <%= f.text_field :quantity,:size=>2 %>
    </p>

    <p>
      <label for="material_active">可用</label>
      <%= f.check_box :active %>
    </p>

    <p>
      <label for="design_active">首页排序</label>
      <%= f.text_field :sort_order,{:size=>5} %>(数值越高排越前)
    </p>

    <p>
      <%= f.submit button_name,:class=>'submit' %>
    </p>
  <% end %>
</div>